﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Collections;
namespace GPCSC.Web.SHFW
{
    public partial class CL_View :  PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                F_bound();//绑定数据

                Button1.OnClientClick = Window1.GetShowReference("SYS_TZt.aspx?id=" + Usual.f_querystringToString("id"), "是否收到");
            }
        }

        protected void F_bound()
        {
            string ids = Usual.f_querystringToString("id");
            DataSet ds = new CL_TZ_S().TzView(ids);
            if (ds.Tables.Count > 0)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    count.InnerHtml = ds.Tables[0].Rows[0]["cont"].ToString();
                    #region 附件信息
                    DataSet dss = new CL_TZ_S().getfile(ds.Tables[0].Rows[0]["CL_TZ_SOID"].ToString());
                    string FJUrls = "";
                    if (dss.Tables.Count > 0)
                    {
                        if (dss.Tables[0].Rows.Count > 0)
                        {
                            FJUrls += "<ul>";
                            foreach (DataRow drf in dss.Tables[0].Rows)
                            {
                                FJUrls += "<li><a href='" + drf["TZURL"].ToString() + "' >" + drf["filename"].ToString() + "</a></li>";
                            }
                            FJUrls += "</ul>";
                        }
                    }
                    FJurl.InnerHtml = FJUrls;

                    #endregion

                    #region 收件人信息
                    DataSet df = new CL_TZ_S().get_CL_TZUSER(ds.Tables[0].Rows[0]["CL_TZ_SOID"].ToString());
                    if (df.Tables.Count > 0)
                    {
                        if (df.Tables[0].Rows.Count > 0)
                        {
                            string sall = "";
                            string ssf = "";
                            foreach (DataRow drs in df.Tables[0].Rows)
                            {
                                sall += drs["jsname"].ToString() + " ";
                                if (drs["isread"].ToString() == "1")
                                {
                                    ssf += drs["jsname"].ToString() + " ";
                                }
                            }
                            Sall.InnerHtml = sall;
                            //Div1.InnerHtml = ssf;
                        }
                    }
                    #endregion
                }
            }
            
        }
    }
}